]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
location: Create Geoclue proxy asynchronously
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Sat, 15 Feb 2014 13:42:43 +0000 (13:42 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Sat, 15 Feb 2014 17:41:26 +0000 (17:41 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=723684

js/ui/status/location.js

index 4a46014878c9f93a3fdcd9d4adb5b46d605138d9..793e5a0b8958879c8f99e0071b20aa4c79496182 100644 (file)
@@ -41,10 +41,19 @@ const Indicator = new Lang.Class({
     },
 
     _onGeoclueAppeared: function() {
-        // FIXME: This should be done async
-        this._proxy = new GeoclueManager(Gio.DBus.system,
-                                         'org.freedesktop.GeoClue2',
-                                         '/org/freedesktop/GeoClue2/Manager');
+        new GeoclueManager(Gio.DBus.system,
+                           'org.freedesktop.GeoClue2',
+                           '/org/freedesktop/GeoClue2/Manager',
+                           Lang.bind(this, this._onProxyReady));
+    },
+
+    _onProxyReady: function (proxy, error) {
+        if (error != null) {
+            log (error.message);
+            return;
+        }
+
+        this._proxy = proxy;
         this._proxy.connect('g-properties-changed', Lang.bind(this, this._sync));
 
         this._sync();